package cn.shiva.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author shiva   2021/10/15 21:43
 */
@Configuration
public class InterceptorConfig implements WebMvcConfigurer {
    @Autowired
    private StreamInterceptor streamInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(streamInterceptor).addPathPatterns("/**/errorDemo");
        WebMvcConfigurer.super.addInterceptors(registry);
    }
}
